#include <iostream>
#include <cstring>
using namespace std;
bool isPalindrome(int x)
{
    /*  string str;
    stringstream ss;
    ss << x;
    ss >> str;
    int length = str.length();
    if (str[0] != str[length - 1])
        return false;

    int mid = length / 2;
    for (int i = 0; i < mid; i++)
    {
        if (str[i] != str[length - 1 - i])
            return false;
    }
    return true;*/
    //法2:
    if (x < 0)
        return false;
    char p[12];
    sprintf(p, "%d", x);

    int length = strlen(p);
    int mid = length / 2;
    for (int i = 0; i < mid; i++)
    {
        if (p[i] != p[length - 1 - i])
            return false;
    }
    return true;
}
int main()
{

    return 0;
}